package packege003.Myenum.bank;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;

public class Accont {
    private String id;
    private String name;
    private String password;
    private BigDecimal balance;
    private BigDecimal limit;
    private AccontStatus status;//枚举 用户状态 如冻结 挂失等状态
    private LocalDate createdtime;//创建时间
    private LocalDateTime updatedtime;//最后操作
    private UserStatus UserStatus;//枚举 客户的状态 VIP 还是普通用户

    public Accont(String id, String name, String password, BigDecimal balance, BigDecimal limit, AccontStatus status, LocalDate createdtime, LocalDateTime updatedtime, UserStatus userStatus) {
        this.id = id;
        this.name = name;
        this.password = password;
        this.balance = balance;
        this.limit = limit;
        this.status = status;
        this.createdtime = createdtime;
        this.updatedtime = updatedtime;
        this.UserStatus = userStatus;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getPassword() {
        return password;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public BigDecimal getLimit() {
        return limit;
    }

    public AccontStatus getStatus() {
        return status;
    }

    public LocalDate getCreatedtime() {
        return createdtime;
    }

    public LocalDateTime getUpdatedtime() {
        return updatedtime;
    }

    public UserStatus getUserStatus() {
        return UserStatus;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public void setLimit(BigDecimal limit) {
        this.limit = limit;
    }

    public void setStatus(AccontStatus status) {
        this.status = status;
    }

    public void setCreatedtime(LocalDate createdtime) {
        this.createdtime = createdtime;
    }

    public void setUpdatedtime(LocalDateTime updatedtime) {
        this.updatedtime = updatedtime;
    }

    public void setUserStatus(UserStatus userStatus) {
        UserStatus = userStatus;
    }

    @Override
    public boolean equals(Object object) {
        if (object == null || getClass() != object.getClass()) return false;
        Accont accont = (Accont) object;
        return Objects.equals(id, accont.id) && Objects.equals(name, accont.name) && Objects.equals(password, accont.password) && Objects.equals(balance, accont.balance) && Objects.equals(limit, accont.limit) && status == accont.status && Objects.equals(createdtime, accont.createdtime) && Objects.equals(updatedtime, accont.updatedtime) && UserStatus == accont.UserStatus;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, password, balance, limit, status, createdtime, updatedtime, UserStatus);
    }

    @Override
    public String toString() {
        return "Accont{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", password='" + "******" + '\'' +
                ", balance=" + balance +
                ", limit=" + limit +
                ", status=" + status +
                ", createdtime=" + createdtime +
                ", updatedtime=" + updatedtime +
                ", UserStatus=" + UserStatus +
                '}';
    }
}
